<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="index-购物车.css">
</head>

<body>
    <div id="app">
        <div class="good">
            <div class="title">
                <span>已选商品</span>
                <button @click="clearGoodCart">清空</button>
            </div>
            <!-- 商品列表 -->
            <div class="good_list" v-for="(item,index) in goodArr" :key="index">
                <div class="goos_img">
                    <img :src="item.pic" alt="">
                </div>
                <div class="good_message">
                    <span class="good_name">{{item.name}}</span>
                    <span class="good_price">￥{{item.price}}</span>
                </div>
                <div class="good_contet">
                    <button @click="minus(item)">-</button>
                    <span>{{item.content}}</span>
                    <button @click="add(item)">+</button>
                </div>
            </div>
            <div v-show="goodArr.length==0" class="empty">购物车空空如也，去逛逛把吧</div>
        </div>
        <div class="summary">
            <div>
                <span>数量:{{sumNum}}</span>
                <span>￥{{sumPrice}}</span>
            </div>
            <button>去结算</button>
        </div>
    </div>


    <script src="vue-2.5.21.js"></script>
    <script src="index-购物车.js"></script>
</body>

</html>